<template>
    <view class="loading">
        <view class="loading-box">
            <u--image :src="'/static/img/login/login.png'" width="96px" height="96px"></u--image>
            <view class="loading-text">聚帮生物CRM</view>
            <u-loading-icon mode="circle" size="40"></u-loading-icon>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {

        }
    },
    onLoad() {
        const token = uni.getStorageSync('token');
        console.log(token)
        setTimeout(() => {
            if(token) {
                uni.switchTab({
                    url: '/pages/index/index'
                })
            } else {
                uni.navigateTo({
                    url: '/pages/login/index'
                })
            }
        }, 1500)
    }
}
</script>

<style scoped lang="scss">
.loading {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    .loading-box {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .loading-text {
        margin: 100rpx 0;
        font-size: 40rpx;
        font-weight: 500;
        color: rgba(12, 16, 25, 1);
    }
}
</style>